# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-lazy-object-proxy
pkgver=1.9.0
pkgrel=3
pkgdesc='A fast and thorough lazy object proxy'
arch=('loong64' 'x86_64')
url="https://github.com/ionelmc/python-lazy-object-proxy"
license=('BSD')
depends=("python")
makedepends=('python-setuptools-scm')
checkdepends=('python-pytest-benchmark')
source=("https://github.com/ionelmc/python-lazy-object-proxy/archive/v$pkgver/$pkgname-$pkgver.tar.gz")
sha512sums=('2757ff4ac791af1ac168388f75e06f509bfdea17f208de67cca5ce800b5d6536ae7b3ac2b528d8e797bbc97af756f7b072fdd052cd188a132407a4ea663352aa')

export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver

build() {
  cd python-lazy-object-proxy-$pkgver
  python setup.py build
}

check() {
  cd python-lazy-object-proxy-$pkgver
  PYTHONPATH="$PWD/build/lib.linux-$CARCH-cpython-311" pytest
}

package() {
  cd python-lazy-object-proxy-$pkgver
  python setup.py install --root="$pkgdir" --optimize=1
  install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
}
